:- begin_tests(hosp_2br).

:- consult(hosp_2br_3).
:- reconsult(conditions).
:- consult(testconditions).

% path(N brigade, N from, N to, path time)
test(path) :-
	path(1,0,1,T), 
	T = 15.

test(path) :- 
	path(2,1,1,T), 
	T = 20.

% store path to list [A,B,T]
test(step) :-
	step(1,1,2,T,ARR),
	T = 110,
	ARR = [1,2,110].

%route(_,X,X,0,[],HC,HC,0).

% route(N brigade, N from, N to, path time, Ps - edges list, HC - total quantity of patients delivered to each hospital before this route, HC - total quantity of patients delivered to each hospital after this route, Pq - number of patients)
% the path through points: X,Z,Y

test(route) :-
	assert(solution(1000,ps,hc)),
	route(1,0,Y,T,Ps,[0,0],HCnew,0),
	Y = 0,
	T = 0,
	Ps = [],
	HCnew = [0,0],
	retract(solution(_,_,_)).

test(route) :-
	assert(solution(1000,ps,hc)),
	route(1,0,Y,T,Ps,[0,0],HCnew,2),
	Y = 1,
	T = 35,
	Ps = [[[], 0, 1, 15], 1, 1, 20],
	HCnew = [2,0],
	retract(solution(_,_,_)).

% solve(TE - total time, PS - list of routs for brigades ([route of Br1 # rout of Br2]), HC - total quantity of patients delivered to each hospital, PQ - number of patients to save)
% example: solve(TE,PS,H,2).
test(solve) :-
	solve(TE,PS,HC,4),
	TE = 45,
	PS = [0, 1, 15, 1, 1, 20, #, 0, 1, 25, 1, 1, 20],
	HC = [4, 0].

:- end_tests(hosp_2br).
